;===================================================================;
; Linux x86 2.6+ structs.inc for FASM
;
; NOTE!
; =====
; This file includes another file (structs_v.inc) which contains
; structure offset and size definitions.
; If you don't need it, just comment out the last line of this file.
;
; The LSCR Project.
;===================================================================;


struc timeval
{
.tv_sec         rd 1
.tv_usec        rd 1
}

struc timezone
{
.tz_minuteswest  rd 1
.tz_dsttime      rd 1
}

struc flock
{
.l_type          rw 1
.l_whence        rw 1
.l_start         rd 1
.l_len           rd 1
.l_pid           rd 1
}

struc rlimit
{
.rlim_cur        rd 1
.rlim_max        rd 1
}

struc rusage
{
.ru_utime        timeval
.ru_stime        timeval
.ru_maxrss       rd 1
.ru_ixrss        rd 1
.ru_idrss        rd 1
.ru_isrss        rd 1
.ru_minflt       rd 1
.ru_majflt       rd 1
.ru_nswap        rd 1
.ru_inblock      rd 1
.ru_oublock      rd 1
.ru_msgsnd       rd 1
.ru_msgrcv       rd 1
.ru_nsignals     rd 1
.ru_nvcsw        rd 1
.ru_nivcsw       rd 1
}

struc statfs
{
.f_type          rd 1
.f_bsize         rd 1
.f_blocks        rd 1
.f_bfree         rd 1
.f_bavail        rd 1
.f_files         rd 1
.f_ffree         rd 1
.f_fsid          rd 1
.f_namelen       rd 1
.f_frsize        rd 1
.f_spare         rd 5
}

struc itimerval
{
.it_interval     timeval
.it_value        timeval
}

struc stat
{
.st_dev          rd 1
.st_ino          rd 1
.st_mode         rw 1
.st_nlink        rw 1
.st_uid          rw 1
.st_gid          rw 1
.st_rdev         rd 1
.st_size         rd 1
.st_blksize      rd 1
.st_blocks       rd 1
.st_atime        rd 1
.st_atime_nsec   rd 1
.st_mtime        rd 1
.st_mtime_nsec   rd 1
.st_ctime        rd 1
.st_ctime_nsec   rd 1
.__unused4       rd 1
.__unused5       rd 1
}

struc timex
{
.modes           rd 1
.offset          rd 1
.freq            rd 1
.maxerror        rd 1
.esterror        rd 1
.status          rd 1
.constant        rd 1
.precision       rd 1
.tolerance       rd 1
.time            timeval
.tick            rd 1
.ppsfreq         rd 1
.jitter          rd 1
.shift           rd 1
.stabil          rd 1
.jitcnt          rd 1
.calcnt          rd 1
.errcnt          rd 1
.stbcnt          rd 1
                rd 12
}

struc dirent
{
.d_ino           rd 1
.d_off           rd 1
.d_reclen        rw 1
.d_name          rb 256
}

struc cap_user_header_t
{
.version         rd 1
.pid             rd 1
}

struc cap_user_data_t
{
.effective       rd 1
.permitted       rd 1
.inheritable     rd 1
}

struc user_desc
{
.entry_number    rd 1
.base_addr       rd 1
.limit           rd 1
.bitfield        rd 1
                ; seg_32bit             :1
                ; contents              :2
                ; read_exec_only        :1
                ; limit_in_pages        :1
                ; seg_not_present       :1
                ; useable               :1
}

struc timespec
{
.tv_sec         rd 1
.tv_nsec        rd 1
}

struc iocb
{
.aio_data        rq 1
.aio_key         rd 1
.aio_reserved1   rd 1
.aio_lio_opcode  rw 1
.aio_reqprio     rw 1
.aio_fildes      rd 1
.aio_buf         rq 1
.aio_nbytes      rq 1
.aio_offset      rq 1
.aio_reserved2   rq 1
.aio_reserved3   rq 1
}

struc io_event
{
.data            rq 1
.obj             rq 1
.res             rq 1
.res2            rq 1
}

NCCS equ 19

struc termios
{
.c_iflag         rd 1
.c_oflag         rd 1
.c_cflag         rd 1
.c_lflag         rd 1
.c_line          rb 1
.c_cc            rb NCCS
}

struc winsize
{
.ws_row          rw 1
.ws_col          rw 1
.ws_xpixel       rw 1
.ws_ypixel       rw 1
}

struc serial_struct
{
.type            rd 1
.line            rd 1
.port            rd 1
.irq             rd 1
.flags           rd 1
.xmit_fifo_size  rd 1
.custom_divisor  rd 1
.baud_base       rd 1
.close_delay     rw 1
.io_type         rb 1
.reserved_char   rb 1
.hub6            rd 1
.closing_wait    rw 1
.closing_wait2   rw 1
.iomem_base      rd 1
.iomem_reg_shift rw 1
.port_high       rd 1
.iomap_base      rd 1
}

struc serial_multiport_struct
{
.irq             rd 1
.port1           rd 1
.mask1           rb 1
.match1          rb 1
.port2           rd 1
.mask2           rb 1
.match2          rb 1
.port3           rd 1
.mask3           rb 1
.match3          rb 1
.port4           rd 1
.mask4           rb 1
.match4          rb 1
.port_monitor    rd 1
.reserved        rd 32
}

struc cdrom_msf
{
.cdmsf_min0      rb 1
.cdmsf_sec0      rb 1
.cdmsf_frame0    rb 1
.cdmsf_min1      rb 1
.cdmsf_sec1      rb 1
.cdmsf_frame1    rb 1
}

struc cdrom_ti
{
.cdti_trk0       rb 1
.cdti_ind0       rb 1
.cdti_trk1       rb 1
.cdti_ind1       rb 1
}

struc cdrom_tochdr
{
.cdth_trk0       rb 1
.cdth_trk1       rb 1
}

struc cdrom_msf0
{
.minute          rb 1
.second          rb 1
.frame           rb 1
}

struc cd_addr
{
.msf:           ;cdrom_msf0
.lba            rd 1
}

struc cdrom_tocentry
{
.cdte_track      rb 1
.cdte_adr        rb 1
.cdte_ctrl       rb 1
.cdte_format     rb 1
.cdte_addr       cd_addr
.cdte_datamode   rb 1
}

struc cdrom_volctrl
{
.channel0        rb 1
.channel1        rb 1
.channel2        rb 1
.channel3        rb 1
}

struc cdrom_subchnl
{
.cdsc_format     rb 1
.cdsc_audiostatus rb 1
.cdsc_adr        rb 1
.cdsc_ctrl       rb 1
.cdsc_trk        rb 1
.cdsc_ind        rb 1
.cdsc_absaddr    cd_addr
.cdsc_reladdr    cd_addr
}

struc cdrom_read
{
.cdread_lba      rd 1
.cdread_bufaddr  rd 1
.cdread_buflen   rd 1
}

struc cdrom_read_audio
{
.msf:            ;cdrom_msf0
.lba             rd 1
.addr_format     rb 1
.nframes         rd 1
.buf             rd 1
}

struc cdrom_addr
{
.msf:            ;cdrom_msf0
.lba             rd 1
}

struc cdrom_multisession
{
.addr            cdrom_addr
.xa_flag         rb 1
.addr_format     rb 1
}

struc cdrom_mcn
{
.medium_catalog_number rb 14
}

struc cdrom_blk
{
.from    rd 1
.len     rw 1
}

struc dvd_layer
{
.bitfield        rb 1
                ; book_version  :4
                ; book_type     :4
.bitfield1       rb 1
                ; min_rate      :4
                ; disc_size     :4
.bitfield2       rb 1
                ; layer_type    :4
                ; track_path    :1
                ; nlayers:2
.bitfield3       rb 1
                ; track_density :4
                ; linear_density:4
.bitfield4       rb 1
                ; bca           :1
.start_sector    rd 1
.end_sector      rd 1
.end_sector_l0   rd 1
}

struc dvd_physical
{
.type            rb 1
.layer_num       rb 1
.layer           dvd_layer
.layer1          dvd_layer
.layer2          dvd_layer
.layer3          dvd_layer
}

struc dvd_copyright
{
.type            rb 1
.layer_num       rb 1
.cpst            rb 1
.rmi             rb 1
}

struc dvd_disckey
{
.type            rb 1
.agid            rd 1
                ; agid          :2
.value           rb 2048
}

struc dvd_bca
{
.type            rb 1
.len             rd 1
.value           rb 188
}

struc dvd_manufact
{
.type            rb 1
.layer_num       rb 1
.len             rd 1
.value           rb 2048
}

struc dvd_struct
{
.type:           ;rb 1
.physical:       ;dvd_physical
.copyright:      ;dvd_copyright
.disckey:        ;dvd_disckey
.bca:            ;dvd_bca
.manufact        dvd_manufact
}

struc dvd_lu_send_agid
{
.type            rb 1
.agid            rd 1
                ; agid          :2
}

struc dvd_host_send_challenge
{
.type            rb 1
.agid           rd 1
                ; agid          :2
.chal            rb 10
}

struc dvd_send_key
{
.type            rb 1
.agid           rd 1
                ; agid          :2
.key             rb 5
}

struc dvd_lu_send_challenge
{
.type            rb 1
.agid           rd 1
                ; agid          :2
.chal            rb 10
}

struc dvd_lu_send_title_key
{
.type            rb 1
.agid           rd 1
                ; agid          :2
.title_key       rb 5
.lba             rd 1
.bitfield        rd 1
                ; cpm           :1
                ; cp_sec        :1
                ; cgms          :2
}

struc dvd_lu_send_asf
{
.type            rb 1
.bitfield       rd 1
                ; agid          :2
                ; asf           :1
}

struc dvd_host_send_rpcstate
{
.type            rb 1
.pdrc            rb 1
}

struc dvd_lu_send_rpcstate
{
.bitfield        rb 1
                ; type          :2
                ; vra           :3
                ; ucca          :3
.region_mask     rb 1
.rpc_scheme      rb 1
}

struc dvd_authinfo
{
.type:    ;rb 1
.lsa:     ;dvd_lu_send_agid
.hsc:     ;dvd_host_send_challenge
.lsk:     ;dvd_send_key
.lsc:     ;dvd_lu_send_challenge
.hsk:     ;dvd_send_key
.lsasf:   ;dvd_lu_send_asf
.hrpcs:   ;dvd_host_send_rpcstate
.lrpcs:   ;dvd_lu_send_rpcstate
.lstk     dvd_lu_send_title_key
}

CDROM_PACKET_SIZE       equ 12

struc cdrom_generic_command
{
.cmd             rb CDROM_PACKET_SIZE
.buffer          rd 1
.buflen          rd 1
.stat            rd 1
.sense           rd 1
.data_direction  rb 1
.quiet           rd 1
.timeout         rd 1
.reserved        rd 1
}

struc sockaddr
{
.sa_family       rw 1
.sa_data         rb 14
}

struc rtentry
{
.rt_pad1         rd 1
.rt_dst          sockaddr
.rt_gateway      sockaddr
.rt_genmask      sockaddr
.rt_flags        rw 1
.rt_pad2         rw 1
.rt_pad3         rd 1
.rt_pad4         rd 1
.rt_metric       rw 1
.rt_dev          rd 1
.rt_mtu          rd 1
.rt_window       rd 1
.rt_irtt         rw 1
}

struc sembuf
{
.sem_num         rw 1
.sem_op          rw 1
.sem_flg         rw 1
}

struc seminfo
{
.semmap          rd 1
.semmni          rd 1
.semmns          rd 1
.semmnu          rd 1
.semmsl          rd 1
.semopm          rd 1
.semume          rd 1
.semusz          rd 1
.semvmx          rd 1
.semaem          rd 1
}

struc semun
{
.val:    ;rd 1
.buf:    ;rd 1
.array:  ;rd 1
.__buf:  ;rd 1
.__pad   rd 1
}

struc ipc_perm
{
.key             rd 1
.uid             rw 1
.gid             rw 1
.cuid            rw 1
.cgid            rw 1
.mode            rw 1
.seq             rw 1
}

struc sem
{
.semval          rd 1
.sempid          rd 1
}

struc sem_undo
{
.proc_next       rd 1
.id_next         rd 1
.semid           rd 1
.semadj          rd 1
}

struc sem_queue
{
.next            rd 1
.prev            rd 1
.sleeper         rd 1
.undo            rd 1
.pid             rd 1
.status          rd 1
.sma             rd 1
.id              rd 1
.sops            rd 1
.nsops           rd 1
.alter           rd 1
}

struc semid_ds
{
.sem_perm        ipc_perm
.sem_otime       rd 1
.sem_ctime       rd 1
.sem_base        rd 1
.sem_pending     rd 1
.sem_pending_last rd 1
.undo            rd 1
.sem_nsems       rw 1
}

struc raw_spinlock_t
{
.slock           rd 1
}

struc spinlock_t
{
.raw_lock                raw_spinlock_t
        match =1 =1, CONFIG_PREEMPT CONFIG_SMP
        \{
        .break_lock      rd 1
        \}
        match =1, CONFIG_DEBUG_SPINLOCK
        \{
        .magic           rd 1
        .owner_cpu       rd 1
        .owner           rd 1
        \}
}

struc kern_ipc_perm
{
.lock            spinlock_t
.deleted         rd 1
.key             rd 1
.uid             rd 1
.gid             rd 1
.cuid            rd 1
.cgid            rd 1
.mode            rw 1
.seq             rd 1
.security        rd 1
}

struc sem_array
{
.sem_perm        kern_ipc_perm
.sem_id          rd 1
.sem_otime       rd 1
.sem_ctime       rd 1
.sem_base        rd 1
.sem_pending     rd 1
.sem_pending_last        rd 1
.undo            rd 1
.sem_nsems       rd 1
}

struc msginfo
{
.msgpool         rd 1
.msgmap          rd 1
.msgmax          rd 1
.msgmnb          rd 1
.msgmni          rd 1
.msgssz          rd 1
.msgtql          rd 1
.msgseg          rw 1
}

struc msqid_ds
{
.msg_perm        ipc_perm
.msg_first       rd 1
.msg_last        rd 1
.msg_stime       rd 1
.msg_rtime       rd 1
.msg_ctime       rd 1
.msg_lcbytes     rd 1
.msg_lqbytes     rd 1
.msg_cbytes      rw 1
.msg_qnum        rw 1
.msg_qbytes      rw 1
.msg_lspid       rw 1
.msg_lrpid       rw 1
}

struc shmid_ds
{
.shm_perm        ipc_perm
.shm_segsz       rd 1
.shm_atime       rd 1
.shm_dtime       rd 1
.shm_ctime       rd 1
.shm_cpid        rw 1
.shm_lpid        rw 1
.shm_nattch      rw 1
.shm_unused      rw 1
.shm_unused2     rd 1
.shm_unused3     rd 1
}

struc shminfo
{
.shmmax          rd 1
.shmmin          rd 1
.shmmni          rd 1
.shmseg          rd 1
.shmall          rd 1
}

struc shm_info
{
.used_ids        rd 1
.shm_tot         rd 1
.shm_rss         rd 1
.shm_swp         rd 1
.swap_attempts   rd 1
.swap_successes  rd 1
}

struc epoll_event
{
.events          rd 1
.data            rq 1
}

struc um_dup_user_desc
{
.entry_number    rd 1
.base_addr       rd 1
.limit           rd 1
.bitfield        rd 1
                ; seg_32bit             :1
                ; contents              :2
                ; read_exec_only        :1
                ; limit_in_pages        :1
                ; seg_not_present       :1
                ; useable               :1
}

NFSCLNT_IDMAX           equ 1024
NFSCLNT_ADDRMAX         equ 16
NFSCLNT_KEYMAX          equ 32
NFS_MAXPATHLEN          equ 1024

struc nfsctl_svc
{
.svc_port        rw 1
.svc_nthreads    rd 1
}

struc nfsctl_client
{
.cl_ident        rb NFSCLNT_IDMAX+1
.cl_naddr        rd 1
.cl_addrlist     rd 16
.cl_fhkeytype    rd 1
.cl_fhkeylen     rd 1
.cl_fhkey        rb NFSCLNT_KEYMAX
}

struc nfsctl_export
{
.ex_client       rb NFSCLNT_IDMAX+1
.ex_path         rb NFS_MAXPATHLEN+1
.ex_dev          rw 1
.ex_ino          rd 1
.ex_flags        rd 1
.ex_anon_uid     rw 1
.ex_anon_gid     rw 1
}

struc nfsctl_fdparm
{
.gd_addr         sockaddr
.gd_path         rb NFS_MAXPATHLEN+1
.gd_version      rd 1
}

struc nfsctl_fsparm
{
gd_addr         sockaddr
gd_path         rb NFS_MAXPATHLEN+1
gd_maxlen       rd 1
}

struc nfsctl_arg
{
.ca_version      rd 1
.u_svc:          ;nfsctl_svc
.u_client:       ;nfsctl_client
.u_getfd:        ;nfsctl_fdparm
.u_getfs:        ;nfsctl_fsparm
.u_ptr:          ;rd 1
.u_export        nfsctl_export
}

NFS_FHSIZE      equ 32
NFS4_FHSIZE     equ 128

struc nfs_fhbase_old
{
.fb_dcookie      rd 1
.fb_ino          rd 1
.fb_dirino       rd 1
.fb_dev          rd 1
.fb_xdev         rd 1
.fb_xino         rd 1
.fb_generation   rd 1
}

struc nfs_fhbase_new
{
.fb_version      rb 1
.fb_auth_type    rb 1
.fb_fsid_type    rb 1
.fb_fileid_type  rb 1
.fb_auth         rd 1
}

struc knfsd_fh
{
.fh_size         rd 1
.fh_old:         ;nfs_fhbase_old
.fh_new:         ;nfs_fhbase_new
.fh_pad          rd NFS4_FHSIZE/4
}

struc nfsctl_res
{
.cr_getfh:       ;rb NFS_FHSIZE
.cr_getfs        knfsd_fh
}

struc pollfd
{
.fd              rd 1
.events          rw 1
.revents         rw 1
}

struc if_dqblk
{
.dqb_bhardlimit  rq 1
.dqb_bsoftlimit  rq 1
.dqb_curspace    rq 1
.dqb_ihardlimit  rq 1
.dqb_isoftlimit  rq 1
.dqb_curinodes   rq 1
.dqb_btime       rq 1
.dqb_itime       rq 1
.dqb_valid       rd 1
}

struc iovec
{
.iov_base        rd 1
.iov_len         rd 1
}

        if defined      CONFIG_SMP
        NR_CPUS         = CONFIG_NR_CPUS
        else
        NR_CPUS         = 1
        end if

struc cpumask_t
{
.bits   rd ((NR_CPUS+31)/32)
}

struc sched_param
{
.sched_priority  rd 1
}

struc fd_set
{
.fds_bits        rd 32
}

struc old_sigaction
{
.sa_handler:     ;rd 1
.sa_sigaction    rd 1
.sa_mask         rd 1
.sa_flags        rd 1
.sa_restorer     rd 1
}

struc sigaltstack
{
.ss_sp           rd 1
.ss_flags        rd 1
.ss_size         rd 1
}

UNIX_PATH_MAX   equ 108

struc sockaddr_un
{
.sun_family      rw 1
.sun_path        rb UNIX_PATH_MAX
}

struc sockaddr_in
{
.sin_family      rw 1
.sin_port        rw 1
.sin_addr        rd 1
.__pad           rb 8
}

struc in6_addr
{
.u6_addr8:        ;rb 16
.u6_addr16:       ;rw 8
.u6_addr32       rd 4
}

struc sockaddr_in6
{
.sin6_family     rw 1
.sin6_port       rw 1
.sin6_flowinfo   rd 1
.sin6_addr       in6_addr
.sin6_scope_id   rd 1
}

struc atalk_addr
{
.s_net           rw 1
.s_node          rb 1
}

struc sockaddr_at
{
.sat_family      rw 1
.sat_port        rb 1
.sat_addr        atalk_addr
.sat_zero        rb 8
}

struc sockaddr_ll
{
.sll_family      rw 1
.sll_protocol    rw 1
.sll_ifindex     rd 1
.sll_hatype      rw 1
.sll_pkttype     rb 1
.sll_halen       rb 1
.sll_addr        rb 8
}

struc sockaddr_x25
{
.sx25_family     rw 1
.sx25_addr       rb 16
}

struc sockaddr_nl
{
.nl_family       rw 1
.nl_pad          rw 1
.nl_pid          rd 1
.nl_groups       rd 1
}

struc sockaddr_ax25
{
.sax25_family    rw 1
.sax25_call      rb 7
.sax25_ndigis    rd 1
}

struc sockaddr_irda
{
.sir_family      rw 1
.sir_lsap_sel    rb 1
.sir_addr        rd 1
.sir_name        rb 25
}

IPX_NODE_LEN    equ 6

struc sockaddr_ipx
{
.sipx_family     rw 1
.sipx_port       rw 1
.sipx_network    rd 1
.sipx_node       rb IPX_NODE_LEN
.sipx_type       rb 1
.sipx_zero       rb 1
}

struc _sap_addr
{
.itf             rw 1
.vpi             rw 1
.vci             rd 1
}

struc sockaddr_atmpvc
{
.sap_family      rw 1
.sap_addr        _sap_addr
}

struc rose_address
{
.rose_addr       rb 5
}

struc sockaddr_rose
{
.srose_family    rw 1
.srose_addr      rose_address
.srose_call      rb 7
.srose_ndigis    rd 1
.srose_digi      rb 7
}

DN_MAXADDL      equ 2
DN_MAXOBJL      equ 16

struc dn_naddr
{
.a_len           rw 1
.a_addr          rb DN_MAXADDL
}

struc sockaddr_dn
{
.sdn_family      rw 1
.sdn_flags       rb 1
.sdn_objnum      rb 1
.sdn_objnamel    rw 1
.sdn_objname     rb DN_MAXOBJL
.sdn_add         dn_naddr
}

ETH_ALEN        equ 6
IFNAMSIZ        equ 16

struc pppoe_addr
{
.sid             rw 1
.remote          rb ETH_ALEN
.dev             rb IFNAMSIZ
}

struc sockaddr_pppox
{
.sa_family       rw 1
.sa_protocol     rd 1
.sa_addr         pppoe_addr
}

struc __sysctl_args
{
.name            rd 1
.nlen            rd 1
.oldval          rd 1
.oldlenp         rd 1
.newval          rd 1
.newlen          rd 1
.__unused        rd 4
}

struc sysinfo
{
.uptime          rd 1
.loads           rd 3
.totalram        rd 1
.freeram         rd 1
.sharedram       rd 1
.bufferram       rd 1
.totalswap       rd 1
.freeswap        rd 1
.procs           rw 1
.pad             rw 1
.totalhigh       rd 1
.freehigh        rd 1
.mem_unit        rd 1
._f              rb 8
}

struc tms
{
.tms_utime       rd 1
.tms_stime       rd 1
.tms_cutime      rd 1
.tms_cstime      rd 1
}

struc old_utsname
{
.sysname         rb 65
.nodename        rb 65
.release         rb 65
.version         rb 65
.machine         rb 65
}

struc ustat
{
.f_tfree         rd 1
.f_tinode        rd 1
.f_fname         rb 6
.f_fpack         rb 6
}

struc utimbuf
{
.actime          rd 1
.modtime         rd 1
}

struc vm86_regs
{
.ebx            rd 1
.ecx            rd 1
.edx            rd 1
.esi            rd 1
.edi            rd 1
.ebp            rd 1
.eax            rd 1
.__null_ds      rd 1
.__null_es      rd 1
.__null_fs      rd 1
.__null_gs      rd 1
.orig_eax       rd 1
.eip            rd 1
.cs             rw 1
.__csh          rw 1
.eflags         rd 1
.esp            rd 1
.ss             rw 1
.__ssh          rw 1
.es             rw 1
.__esh          rw 1
.ds             rw 1
.__dsh          rw 1
.fs             rw 1
.__fsh          rw 1
.gs             rw 1
.__gsh          rw 1
}

struc revectored_struct
{
.__map           rd 8
}

struc vm86plus_info_struct
{
.bitfield                rd 1
                        ; force_return_for_pic  :1
                        ; vm86dbg_active        :1
                        ; vm86dbg_TFpendig      :1
                        ; unused                :28
                        ; is_vm86pus            :1
.vm86dbg_intxxtab        rb 32
}

struc vm86plus_struct
{
.regs                    vm86_regs
.flags                   rd 1
.screen_bitmap           rd 1
.cpu_type                rd 1
.int_revectored          revectored_struct
.int21_revectored        revectored_struct
.vm86plus                vm86plus_info_struct
}

struc linger
{
.l_onoff         rd 1
.l_linger        rd 1
}

struc ucred
{
.pid             rd 1
.uid             rd 1
.gid             rd 1
}

struc sock_extended_err
{
.ee_errno        rd 1
.ee_origin       rb 1
.ee_type         rb 1
.ee_code         rb 1
.ee_pad          rb 1
.ee_info         rd 1
.ee_data         rd 1
}

struc msghdr
{
.msg_name        rd 1
.msg_namelen     rd 1
.msg_iov         rd 1
.msg_iovlen      rd 1
.msg_control     rd 1
.msg_controllen  rd 1
.msg_flags       rd 1
}

struc user_regs_struct
{
.ebx            rd 1
.ecx            rd 1
.edx            rd 1
.esi            rd 1
.edi            rd 1
.ebp            rd 1
.eax            rd 1
.ds             rw 1
.__ds           rw 1
.es             rw 1
.__es           rw 1
.fs             rw 1
.__fs           rw 1
.gs             rw 1
.__gs           rw 1
.orig_eax       rd 1
.eip            rd 1
.cs             rw 1
.__cs           rw 1
.eflags         rd 1
.esp            rd 1
.ss             rw 1
.__ss           rw 1
}

struc user_i387_struct
{
.cwd             rd 1
.swd             rd 1
.twd             rd 1
.fip             rd 1
.fcs             rd 1
.foo             rd 1
.fos             rd 1
.st_space        rd 20
}

struc user
{
.regs            user_regs_struct
.u_fpvalid       rd 1
.i387            user_i387_struct
.u_tsize         rd 1
.u_dsize         rd 1
.u_ssize         rd 1
.start_code      rd 1
.start_stack     rd 1
.signal          rd 1
.reserved        rd 1
.u_ar0           rd 1
.u_fpstate       rd 1
.magic           rd 1
.u_comm          rb 32
.u_debugreg      rd 8
}

struc sigset
{
.sig            rd 2
}

struc sigcontext
{
.gs             rw 1
.__gsh          rw 1
.fs             rw 1
.__fsh          rw 1
.es             rw 1
.__esh          rw 1
.ds             rw 1
.__dsh          rw 1
.edi            rd 1
.esi            rd 1
.ebp            rd 1
.esp            rd 1
.ebx            rd 1
.edx            rd 1
.ecx            rd 1
.eax            rd 1
.trapno         rd 1
.err            rd 1
.eip            rd 1
.cs             rw 1
.__csh          rw 1
.eflags         rd 1
.esp_at_signal  rd 1
.ss             rw 1
.__ssh          rw 1
.fpstate        rd 1
.oldmask        rd 1
.cr2            rd 1
}

struc ucontext
{
.uc_flags       rd 1
.uc_link        rd 1
.uc_stack       sigaltstack
.uc_mcontext    sigcontext
.uc_sigmask     sigset
}

struc kill
{
._pid           rd 1
._uid           rd 1
}

struc timer
{
._tid            rd 1
._overrun        rd 1
.sival_int:      ;rd 1
.sival_ptr       rd 1
._sys_private    rd 1
}

struc _rt
{
._pid            rd 1
._uid            rd 1
.sival_int:      ;rd 1
.sival_ptr       rd 1
}

struc sigchld
{
._pid            rd 1
._uid            rd 1
._status         rd 1
._utime          rd 1
._stime          rd 1
}

struc sigfault
{
._addr           rd 1
}

struc sigpoll
{
._band           rd 1
._fd             rd 1
}

struc siginfo
{
.si_signo        rd 1
.si_errno        rd 1
.si_code         rd 1
._kill:          ;kill
._timer:         ;timer
.__rt:           ;_rt
._sigchld:       ;sigchld
._sigfault:      ;sigfault
._sigpoll:       ;sigpoll
._pad            rd 29
}

struc ipc_kludge
{
.msgp           rd 1
.msgtyp         rd 1
}

struc msgbuf    ; this is actually a variable length structure
{
.mtype          rd 1
.mtext          rb 1
}

struc vm86_struct
{
.regs                   vm86_regs
.flags                  rd 1
.screen_bitmap          rd 1
.cpu_type               rd 1
.int_revectored         revectored_struct
.int21_revectored       revectored_struct
}

struc stat64
{
.st_dev          rq 1
.__pad0          rb 4
.__st_ino        rd 1
.st_mode         rd 1
.st_nlink        rd 1
.st_uid          rd 1
.st_gid          rd 1
.st_rdev         rq 1
.__pad3          rb 4
.st_size         rq 1
.st_blksize      rd 1
.st_blocks       rq 1
.st_atime        rd 1
.st_atime_nsec   rd 1
.st_mtime        rd 1
.st_mtime_nsec   rd 1
.st_ctime        rd 1
.st_ctime_nsec   rd 1
.st_ino          rq 1
}

struc flock64
{
.l_type          rw 1
.l_whence        rw 1
.l_start         rq 1
.l_len           rq 1
.l_pid           rd 1
}

struc statfs64
{
.f_type         rd 1
.f_bsize        rd 1
.f_blocks       rq 1
.f_bfree        rq 1
.f_bavail       rq 1
.f_files        rq 1
.f_ffree        rq 1
.f_fsid         rd 1
.f_namelen      rd 1
.f_frsize       rd 1
.f_spare        rd 1
}

struc dirent64
{
.d_ino          rq 1
.d_off          rq 1
.d_reclen       rw 1
.d_type         rb 1
.d_name         rb 256
}

struc mq_attr
{
.mq_flags       rd 1
.mq_maxmsg      rd 1
.mq_msgsize     rd 1
.mq_curmsgs     rd 1
.__reserved     rd 4
}

struc sigev_thread
{
._function      rd 1
._attribute     rd 1
}

struc sigval
{
.sival_int:     ;rd 1
.sival_ptr      rd 1
}

struc sigevent
{
.sigev_value    sigval
.sigev_signo    rd 1
.sigev_notify   rd 1
._tid:          ;rd 1
._sigev_thread: ;sigev_thread
._pad           rd 13
}

struc mmap_arg_struct
{
.addr           rd 1
.len            rd 1
.prot           rd 1
.flags          rd 1
.fd             rd 1
.offset         rd 1
}

struc ifmap
{
.mem_start      rd 1
.mem_end        rd 1
.base_addr      rw 1
.irq            rb 1
.dma            rb 1
.port           rb 1
}

struc if_settings
{
.type           rd 1
.size           rd 1
.raw_hdlc:      ;rd 1
.cisco:         ;rd1
.fr:            ;rd1
.fr_pvc:        ;rd1
.fr_pvc_info:   ;rd1
.sync:          ;rd1
.te1            rd 1
}

IFNAMSIZ        equ 16

struc ifreq
{
.ifrn_name      rb IFNAMSIZ
.ifru_addr:     ;sockaddr
.ifru_dstaddr:  ;sockaddr
.ifru_broadaddr:        ;sockaddr
.ifru_netmask:  ;sockaddr
.ifru_hwaddr:   ;sockaddr
.ifru_flags:    ;rw 1
.ifru_ivalue:   ;rd 1
.ifru_mtu:      ;rd 1
.ifru_map:      ;if_map
.ifru_slave:    ;rb IFNAMSIZ
.ifru_data:     ;rd 1
.ifru_settings: ;if_settings
.ifru_newname   rb IFNAMSIZ
}

struc ifconf
{
.ifc_len        rd 1
.ifcu_buf:      ;rd 1
.ifcu_req       rd 1
}

struc arpreq
{
.arp_pa         sockaddr
.arp_ha         sockaddr
.arp_flags      rd 1
.arp_netmask    sockaddr
.arp_dev        rb 16
}

struc consolefontdesc
{
.charcount      rw 1
.charheight     rw 1
.chardata       rd 1
}

struc unipair
{
.unicode        rw 1
.fontpos        rw 1
}

struc unimapdesc
{
.entry_ct       rw 1
.entries        rd 1
}

struc unimapinit
{
.advised_hashsize       rw 1
.advised_hashstep       rw 1
.advised_hashlevel      rw 1
}

struc kbentry
{
.kb_table       rb 1
.kb_index       rb 1
.kb_value       rw 1
}

struc kbsentry
{
.kb_func        rb 1
.kb_string      rb 512
}

struc kbdiacr
{
.diacr          rb 1
.base           rb 1
.result         rb 1
}

struc kbdiacrs
{
.kb_cnt         rd 1
.kbdiacr        rb 256*3
}

struc kbkeycode
{
.scancode       rd 1
.keycode        rd 1
}

struc kbd_repeat
{
.delay          rd 1
.period         rd 1
}

struc console_font_op
{
.op             rd 1
.flags          rd 1
.width          rd 1
.height         rd 1
.charcount      rd 1
.data           rd 1
}

struc console_font
{
.width          rd 1
.height         rd 1
.charcount      rd 1
.data           rd 1
}

struc vt_mode
{
.mode           rb 1
.waitv          rb 1
.relsig         rw 1
.acqsig         rw 1
.frsig          rw 1
}

struc vt_stat
{
.v_active       rw 1
.v_signal       rw 1
.v_state        rw 1
}

struc vt_consize
{
.v_rows         rw 1
.v_cols         rw 1
.v_vlin         rw 1
.v_clin         rw 1
.v_vcol         rw 1
.v_ccol         rw 1
}

struc vt_sizes
{
.v_rows         rw 1
.v_cols         rw 1
.v_scrollsize   rw 1
}

struc itimerspec
{
.it_interval    timespec
.it_value       timespec
}

include 'structs_v.inc'
